import request from '@/utils/request'

// 查询生产领料单头列表
export function listWmIssueHeader(data) {
  return request({
    url: '/WmIssueHeader/WmIssueHeader/page',
    method: 'post',
    data: data
  })
}
// 根据id查询生产领料单头列表
export function listLine1(issueId) {
   return request.get('/IssueLine/IssueLine/checkLine',{params: { issueId: issueId }}) 
}
// 查询生产领料单头详细
export function getWmIssueHeader(issueId) {
  return request({
    url: '/WmIssueHeader/WmIssueHeader/info',
    method: 'post',
    data: {issueId}
  })
}

// 新增生产领料单头
export function addWmIssueHeader(data) {
  return request({
    url: '/WmIssueHeader/WmIssueHeader/add',
    method: 'post',
    data: data
  })
}

// 修改生产领料单头
export function updateWmIssueHeader(data) {
  return request({
    url: '/WmIssueHeader/WmIssueHeader/update',
    method: 'post',
    data: data
  })
}

// 删除生产领料单头
export function delWmIssueHeader(issueId) {
  return request({
    url: '/WmIssueHeader/WmIssueHeader/delete',
    method: 'post',
    data: {issueId}
  })
}
// 前端 deleteLine 接口调用（改为请求体传数组）
export function deleteLine(issueIds) {
  return request({
    url: '/IssueLine/IssueLine/deleLine',
    method: 'post',
    data: issueIds // 直接传数组，后端用 @RequestBody 接收
  });
}

